﻿//<TunynetCopyright>
//--------------------------------------------------------------
//<copyright>青岛拓宇网络科技有限公司 2005-2008</copyright>
//<version>V0.5</verion>
//<createdate>3/19/2008 4:16:16 PM</createdate>
//<author>xier</author>
//<email>xier@tunynet.com</email>
//<log date="3/19/2008 4:16:16 PM">创建</log>
//--------------------------------------------------------------
//</TunynetCopyright>

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Tunynet.QingdaoCustoms.Serialization;

namespace ChinaCustoms.Qingdao.Workflow.Supports.DataProvider
{
    /// <summary>
    /// DataProvider帮助类
    /// </summary>
    public class DataProviderHelper
    {
        public static SerializerData PopulateSerializerDataFromDataReader(IDataReader dr)
        {
            SerializerData data = new SerializerData();

            if (dr["PropertyNames"] == DBNull.Value)
            {
                data.Keys = string.Empty;
            }
            else
            {
                data.Keys = Convert.ToString(dr["PropertyNames"]);
            }

            if (dr["PropertyValues"] == DBNull.Value)
            {
                data.Values = string.Empty;
            }
            else
            {
                data.Values = Convert.ToString(dr["PropertyValues"]);
            }

            return data;
        }

    }
}
